// 参数： 父节点id，主项目id，时间，负责人，是否完成，文件id
const { sequelize, DataTypes } = require('sequelize');
const { ISFORCE } = require("../utils/dot");

const { Op } = require('sequelize');
const seq = require("../db/index");
const nodeInfoModel = seq.define('nodeInfoModel', {
    parentId: {
        type: DataTypes.INTEGER,
        allowNull: false,
        comment: "父节点id"
    },
    projectId: {
        type: DataTypes.INTEGER,
        comment: "主项目id"
    },
    time: {
        type: DataTypes.DATE,
        allowNull: false,
        comment: "时间"
    },
    projectLeader: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: "负责人"
    },
    isComplete: {
        type: DataTypes.BOOLEAN,
        defaultValue: false,
        comment: "是否完成"
    },
    fileId: {
        type: DataTypes.INTEGER,
        allowNull: false,
        comment: "文件id"
    },
    fileUrl: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: "文件路径"
    }
}, {});

if (ISFORCE == "true") {
    nodeInfoModel.sync({ force: true });
}
// nodeInfoModel.sync({ force: true });

module.exports = nodeInfoModel;